<?php

/**
 * lrArticleAdmin admin form
 *
 * @package    LRCMS
 * @subpackage lrArticleAdmin
 * @author     Thomas Ohms <http://www.lokarabia.de>
 */
class LrArticleAdminForm extends BaseLrArticleForm {
    public function configure() {
        parent::configure();

        $this->widgetSchema['is_active']->setLabel('Active') ;
        $this->widgetSchema['related_product_list_list']->setLabel('Select Product') ;
        $this->validatorSchema['title']->setOption('required',true);
        $this->validatorSchema['summary']->setOption('required',true);

        unset( $this['body'] );
        
//        $lrNewsletterForm = new BaseForm();
//
//        $i = 0;
//        foreach ($this->getObject()->getNewsletter() as $lrNewsletter) {
//            $lrNewsletterAdminForm = new LrNewsletterAdminForm($lrNewsletter);
//            $lrNewsletterForm->embedForm('lrNewsletter_'.$i, $lrNewsletterAdminForm);
//            $lrNewsletterForm->widgetSchema['lrNewsletter_'.$i]->setLabel('&nbsp;');
//            $i++;
//        }
//        $empty_field = 1;
//        if($i) {
//            $empty_field = ($empty_field/2);
//        }
//
//        for ($j = 1; $j <= 1; $j++) {
//            $lrNewsletter = new LrNewsletter();
//            $lrNewsletter->Newsletter = $this->getObject();
//
//            $lrNewsletterAdminForm = new LrNewsletterAdminForm($lrNewsletter);
//            $lrNewsletterForm->embedForm('lrNewsletter_'.$i, $lrNewsletterAdminForm);
//            $lrNewsletterForm->widgetSchema['lrNewsletter_'.$i]->setLabel('&nbsp;');
//            $i++;
//        }
//
//        $this->embedForm('lrNewsletter_group_form', $lrNewsletterForm);
    }
    protected function createMediaFormForImage() {
        // get the DmMedia form
        $form = parent::createMediaFormForImage();

        // choose mime types allowed
        $form->setMimeTypeWhiteList(array(
                'image/jpeg',
                'image/png',
                'image/jpg',
                'image/gif'
        ));
        unset($form['legend'], $form['author'], $form['license']);
        return $form;
    }
}